package com.javen.springbootneo4j.entity.node;

import com.javen.springbootneo4j.entity.node.City;
import com.javen.springbootneo4j.entity.relation.LivesIn;
import org.springframework.data.neo4j.core.schema.GeneratedValue;
import org.springframework.data.neo4j.core.schema.Id;
import org.springframework.data.neo4j.core.schema.Node;
import org.springframework.data.neo4j.core.schema.Relationship;

import java.util.List;

/**
 * @Description: com.javen.springbootneo4j.entity
 * @Author: tujw@netinnet.cn
 * @Date: 2024/2/28 13:40
 */
@Node
public class Person {

    @Id
    @GeneratedValue
    private Long id;
    private String name;

    /**
     * 关系-籍贯，请注意，这种方式适用于不需要对关系本身进行独立查询或操作的情况。如果需要对关系实体执行更复杂的操作（如添加属性等），则可能需要给关系实例创建单独的关系实体，并通过Neo4jTemplate或其他方式来管理。
     */
//    @Relationship(type = "NATIVE_PLACE", direction = Relationship.Direction.OUTGOING)
//    private City city;

    // 多对多关系，一个人可以居住在多个城市
//    @Relationship(type = "LIVES_IN", direction = Relationship.Direction.OUTGOING)
//    private List<LivesIn> livesInRelations;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

//    public City getCity() {
//        return city;
//    }
//
//    public void setCity(City city) {
//        this.city = city;
//    }
//
//    public List<LivesIn> getLivesInRelations() {
//        return livesInRelations;
//    }
//
//    public void setLivesInRelations(List<LivesIn> livesInRelations) {
//        this.livesInRelations = livesInRelations;
//    }
}
